<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<h1>标题</h1>
		<p id="p01">
			<span>开头</span>
			<span>内容</span><span></span></p>
		<script type="text/javascript">
			window.onload = function() {
				console.log("节点名字:" + document.body.nodeName);
				console.log("节点类型:" + document.body.nodeType);
				console.log("节点值:" + document.body.nodeValue);

				console.log("子节点:" + document.body.childNodes);
				console.log("子节点:" + document.body.childNodes.length);

				// var p01 = document.getElementById("p01");
				console.log(p01.nodeName); // P
				console.log(p01.nodeType); // 1
				console.log(p01.nodeValue);
				console.log("子节点:" + p01.childNodes.length);

				console.log(p01.childNodes[0].nodeName)
				console.log(p01.childNodes[0].nodeType)
				console.log(p01.childNodes[0].nodeValue)

			}
		</script>
	</body>
</html>
